/*
 * Link.h
 *
 *  Created on: 17.04.2012
 *      Author: Eugene Kornykhin
 */

#ifndef LINK_H_
#define LINK_H_

#include "../PElement.h"

class Link: public PElement {
public:
	Link(string name, const Poliz&);
	virtual ~Link();

	string getName() const;

	virtual void execute(Interpreter &);

	virtual PolizPosition next_position_after(PolizPosition) const;
	virtual bool isHalt() const;
	virtual Link *clone(const Poliz &) const;
	string toString() const;

	PolizPosition getDestination() const;

	static string createFreshLinkName();

private:
	string name;
	const Poliz &poliz;

	static int fresh_links;
};

#endif /* LINK_H_ */
